<!DOCTYPE html>
<?php if (!is_fang90_server_name()) : ?>
<!-- 
┏┓╋┏┓╋┏┓╋╋╋╋╋╋┏━┓
┃┃╋┃┃╋┃┃╋╋╋╋╋╋┃┏┛
┃┃╋┃┣━┛┣┳━━┳━┳┛┗┳━━┳━┓┏━━┓
┃┃╋┃┃┏┓┣┫┏┓┃┏╋┓┏┫┏┓┃┏┓┫┏┓┃
┃┗━┛┃┗┛┃┃┏┓┃┃┃┃┃┃┏┓┃┃┃┃┗┛┃
┗━━━┻━━┻┻┛┗┻┛┗┻┛┗┛┗┻┛┗┻━┓┃
╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏━┛┃
╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┗━━┛

http://udfang.com
Work with us? We're a fun bunch!  http://udfang.com/about
-->
<?php endif; ?>
<html lang="zh-CN">
<head>
    <?php 
        $websiteName = is_fang90_server_name() ? "房90" : "U点房";
        if (is_plusfang_server_name()) {
            $websiteName = 'Plus fang';
        }
    ?>
    <title><?php e($city->area_name); ?>新房，上海新房楼盘价格 / <?php e($websiteName); ?></title>
    <meta content='IE=Edge' http-equiv='X-UA-Compatible'>
    <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
    <link rel="shortcut icon" type="image/x-icon" href="/<?php if(is_fang90_server_name()) : ?>f90.ico<?php else : ?>favicon.ico<?php endif; ?>" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimal-ui" />
    <meta content='<?php e($city->area_name); ?>楼盘,<?php e($city->area_name); ?>新开楼盘,<?php e($city->area_name); ?>房价走势,<?php e($city->area_name); ?>新楼盘精选' name='keywords'>
    <meta content='<?php e($websiteName); ?>为您精选推荐最新楼盘信息，精选开盘楼盘信息，精选在售楼盘信息，了解和关注更多精选新楼盘信息，就上<?php e($websiteName); ?>。' name='description'>
    <link rel="stylesheet" href="/assets/css/building/reset.css" />
    <link rel="stylesheet" href="/assets/css/building/index_3.0.css" />
    <link rel="stylesheet" href="/assets/css/mobilelist/style.css" />

    <script type="text/javascript">
        var oHtml = document.documentElement;
        getFont();
        window.onresize = function(){
            getFont();
        }  
        function getFont(){
            var screenWidth = oHtml.clientWidth;//获取屏幕的宽度
            if(screenWidth <= 320){

                oHtml.style.fontSize = '50px';//最小值
            }else if(screenWidth >= 640){

                oHtml.style.fontSize = '100px';//最大值
            }else{

                oHtml.style.fontSize = screenWidth/(640/100)+'px';//公式

            }   
        }
    </script>
    <style type="text/css">
        .filter li{
            font-size: 18px;
        }
        #showcity{
            font-size: 20px;
        }
        .new-find,.right{
            display: none;
        }
        #search_building{
            font-size: 16px;
        }
        .container {
            padding-top: 0px;
        }
    </style>
</head>
<body>
    <?php // $this->load->view('../home/nav') ?>
            <!-- container -->
    <section class="container">      
        <!-- <h2 class="hot-city">热门城市</h2> -->
        <!-- citylist -->
        <section class="citylist-wrap">
            <?php if ($buildings) : ?>
            <?php foreach ($buildings as $key => $val) : ?>
                <section class="citylist">
                    <a href="<?php if(isset($qd) && !empty($qd)){echo "/building/{$city->code}/{$val->building_id}?qd={$qd}";}else{echo "/building/{$city->code}/{$val->building_id}";}  ?>" target="_blank">
                    <img class="city-pic" src="<?php e($val->cover->absolute_url); ?>"/>
                    <h3><?php e($val->name); ?></h3>
                    <p class="price">
                        <?php if($val->price_desc != ''): ?>
                        <strong class="fc5a5f"><?php echo $val->price_desc; ?></strong>
                         <?php else: ?>
                            <?php if ($val->ave_price != 0): ?>
                                <strong class="fc5a5f"> ¥<?php e($val->ave_price); ?></strong>元/平米
                            <?php else: ?><strong class="fc5a5f">价格待定</strong><?php endif; ?>
                        <?php endif; ?>
                    </p>
                    <p class="adress"><?php if($val->district): ?>[<?php e($val->district->area_name); ?>]<?php endif; ?> <?php e($val->address); ?></p>
                    <p class="lable"><span><?php e(building_status_site_name()[$val->status]); ?></span><?php foreach ($val->tags as $tag) : ?><span><?php e($tag->tag_name); ?></span><?php endforeach; ?></p>
                    </a>
                    <section class="contactus clearfix">
                        <a href="javascript:;" onclick="consultation('<?php echo $val->ext_mobile_phone;?>')"  class="consultation"><i class="iconfont">&#xe601;</i>免费咨询</a>
                        <a href="javascript:;" class="appointment book" bid="<?php echo $val->building_id;?>" bcode="<?php echo $val->code;?>"><i class="iconfont">&#xe602;</i>预约看房</a>
                    </section>
                </section>
            <?php endforeach; ?>
            <?php else : ?>
                <p style="padding: 20px 0 20px 3%; font-size: 16px;">没有找到楼盘</p>
            <?php endif; ?>
        <?php echo $this->pagination->create_links(); ?>    
        </section>
        <!-- more -->
    </section>

    <!--预约看房S-->
    <div class="tanchu tanchu-mobile tanchu_3" style="display: none;">
        <div class="titlebar">
            <button class="close"></button>
            <h5>立即预约看房</h5>
        </div>
        <div class="textbar">
            <input type="hidden" class="building-id-input" curbid="0" curbcode="" />
            <p><span>1.输入手机号</span><span class="arrow-to-right"></span><span>2.预约成功</span></p>
            <input class="phone-input" type="text" placeholder="请输入手机号" value="" id="yuyue_mb" />
            <div class="random" style="display:none;">
                <input class='code-input' type='text' placeholder='请输入验证码' id="phone_code_yuyemb_input" style="margin-left:0;" />
                <button class="sms-btn code-btn" onclick="refreshPhoneCode($('#yuyue_mb').val());" style="margin-right:30px;">获取验证码</button>
                <div class="clearfix"></div>
            </div>
            <div class="wrong-input wrong-input2" id="wrong-input-phone-code-yuyue-mb">验证码输入错误</div>
            <input id="BtnPhone_6" class="SubBtn SubBtn_dh" type="submit" value="预约看房" event-name="立即预约" />
        </div>
    </div>
    <!--预约看房E-->
    <script src="/assets/js/building/jquery-1.11.1.min.js"></script> 
    <?php //$this->load->view('../home/analytics') ?>
    <script type="text/javascript">
    var isFang90com = <?php echo is_fang90_server_name() ? 1 : 0 ?>;
    var isMobile = <?php echo $is_mobile ? 1 : 0; ?>;
    var isPad = <?php echo $is_pad; ?>;
    var buildingChannel = "<?php echo $channel; ?>";
    var buildingCookieId = "<?php echo $buildingCookieId; ?>";
    //拨打电话 consultation
    function consultation(mobile){

        location.href = "tel:"+mobile;
        editCtoBtnuseraction(mobile, 2);
    }

    $(function(){

        
        $('.new-city').click(function(){
            $('.contain').toggle();
        })
        //搜索
        $('#search_building').bind('input propertychange',function() { 
            var input_value = $(this).val();
            var city_id = $('#showcity').attr('city-id');
            //alert(city_id);return false;
            if(input_value != "" || undefined){
                var URL = "/buildings/front/buildinginfo/search";
                $.ajax({
                    type:"get",
                    url:URL,
                    data: {'keyword':input_value,'city_id':city_id},
                    dataType:'json',
                    success:function(msg){
                        //console.log(msg);
                        if(msg){
                            console.log(msg);
                            var len = msg.length;
                            //console.log(len);
                            var str = "";
                            if (msg != 2 && len > 0) {
                                for (var i = 0; i < len; i++) {
                                    str += '<li bid="' + msg[i].building_id + '" citycode="' + msg[i].city_info['code'] + '" ><a href="/building/' + msg[i].city_info['code'] + '/' + msg[i].building_id + '/campaign"> <h3>' + msg[i].name + '</h3><p>' + msg[i].address_show + '</p></a></li>';
                                }
                            } else {
                                str += '<li style="width:275px;height:35px;line-height:35px; padding: 2px 15px; color:grey; font-size: 16px">抱歉,没有找到相关楼盘</li>';
                            }
                            $(".search-list").show();
                            $(".search-list").html(str);
                        }
                    },
                })
            }else{
                $(".search-list").hide();
            }
        })
        $(".close").click(function(){
            $(".tanchu_mask, .tanchu_3").hide();
        });
        // 预约看房弹窗
        $(".book").click(function(){
            if (isMobile && isPad==0) {
                var bid = $(this).attr("bid");
                if(bid != 0){
                    $(".building-id-input").attr('curbid', bid);
                }else{
                    alert("楼盘ID有错误");
                }
                var bcode = $(this).attr("bcode");
                $(".building-id-input").attr('curbcode', bcode);
                $(".tanchu_mask").show();
                $(".tanchu_3").show();

            }
        }) 

        // 手机端预约看房 
        $("#BtnPhone_6").click(function(){
            var mobile = $("#yuyue_mb").val();
            var eventName = $(this).attr("event-name");
            var phone_code_yuyemb_input = $("#phone_code_yuyemb_input").val();
            var buildingId = $(".building-id-input").attr('curbid');
            if(buildingId == 1691){
                var username = $("#yuyue_username").val();
                if (username == ""){
                    $("#yuyue_username").addClass("empty-input");
                    return false;
                } 
            }
            // 不输手机号placeholder变红
            if (mobile == ""){
                $("#yuyue_mb").addClass("empty-input");
                return false;
            }
            // 手机号不符合正则表达式变红
            if (!mobile.match(/^1[3|4|5|7|8]\d{9}$/)){
                $("#yuyue_mb").addClass("warning-input");
                return false;
            }
            // // usure
            // eventClickUSure(mobile, 6);
            // // 思盈
            // siyin_event("mob_Reserve", "4492afeef787a5e9cd7da0dd9d156f3f", mobile);
            // //秒针
            // stm_clicki('send', 'event', '预约看房', '点击');
            $.ajax({
                method: "GET",
                url: "/buildings/front/building/kanfang",
                data: {mobile:mobile, building_id:buildingId, phone_code:phone_code_yuyemb_input}
            }).done(function(data){
                if (data == 'ok') {
                    $(".tanchu_3").fadeOut();
                    $("#yuyue_mb").val("");
                    $(".tanchu_3 .random").hide();
                    // 弹出ok
                    $(".tanchu_mask").show();
                    $(".tanchu_ok").show();
                    $(".tanchu_ok").show();
                    //buildingEventLog(eventName, mobile);
                    // 品友
                    //signUpCvtN('预约看房', buildingName);
                    editCtoBtnuseraction(mobile, 11);
                    if (buildingId == 1632) {
                        // 百度dsp
                        //_hmt.push(['_trackPageview', '/building/shanghai/1632/campaign?qd=bd/success']);
                    }
                    // 百度
                   // _hmt.push(['_trackPageview', '/ljyy']);
                }else if (data == 'auth_code') {
                    // 需要手机验证码
                    $(".tanchu_3 .random").show();
                } else {
                    alert(data);
                }
                // $(".tanchu_mask").fadeOut();
            })
        });

        
        // $(".consultation").click(function(){
        //     if (isMobile && isPad==0) {
        //         // 移动端
        //         location.href = "";
        //         editCtoBtnuseraction('', 2);
        //     }
        // });
})
    //cto统计
    function editCtoBtnuseraction(mobile, type){
        var yyname = '';
        if(type == 0 || type == 2){
            // signUpEntryCvtN("拨打电话", buildingName);
            // if (isFang90com) {
            //     pyRegisterCvt(mobile); // 品友 fang90.com
            // }
        }else if(type == 1){
            // signUpEntryCvtN("发送给我", buildingName);
        }else if(type == 10 || type == 11){
            if(buildingId == 1691){
                if(type == 10){
                    yyname = encodeURI(encodeURI($("#pc_yuyue_username").val()));
                }else{
                    yyname = encodeURI(encodeURI($("#yuyue_username").val()));
                }
                
            }
            //signUpEntryCvtN("预约看房", buildingName);
            if (isFang90com) {
               // pyYuyueCvt(); // 品友 fang90.com
            }
        }
        if(mobile == ''){
            mobile = isMobile ? 'mobile' : 'pc';
        }
        var page = "";//"{$page}";
        //保存用户信息
        //mobile手机号，projectNo分机号，type[pc免费通话是0 ,pc发送地址是1,3免费咨询，4发送给我,5,立即参加，6加载更多 9查看户型图 10预约看房，移动端拨打电话2，加载更多为7 8查看户型图 11预约看房 ],channel渠道数字标识，page站内导航中楼盘网站编码
        var data = "mobile="+mobile+"&projectNo="+buildingPhoneExt+"&type="+type+"&channel="+buildingChannel+"&page="+page+"&cookie="+buildingCookieId+"&name="+yyname+"&ip=<?php e($ip_address); ?>";
        console.log(data);
        var url = "http://test.qwzt.net:8080/dms/customer/custAction?"+data;
        $.ajax({
            url:url,
            type:"get",
            dataType:'jsonp'
        });
    }
        // 发送短信验证码
        function refreshPhoneCode(mobile) {

            var count = 59;
            $(".sms-btn").attr("disabled", true);
            $(".sms-btn").addClass("code-btn-disable");
            $(".sms-btn").html("重新获取(60)");
            var countdown = setInterval(settime, 1000);
            var building_code = $(".building-id-input").attr('curbcode');
            $.getJSON("/buildings/front/building/ajaxSendCode",{mobile:mobile, building_code:building_code},function(logJson) {
                if (logJson.status == 'ok') {
                    alert("验证码发送成功");
                }else{
                    alert(logJson.status);
                }
            });

            function settime() {
                $(".sms-btn").html("重新获取(" + count + ")");

                if (count == 0) {
                    clearInterval(countdown);
                    $(".sms-btn").removeClass("code-btn-disable");
                    $(".sms-btn").html("获取验证码");
                    $(".sms-btn").attr("disabled", false);
                }
                count--;
            }
        }

        // 刷新验证码
        function reloadCaptcha() {
            var captcha_img = $("#captcha_img");
            var src = captcha_img.attr('src');
            captcha_img.attr('src', src);
        }
		
</script>
</body>
</html>